package com.baizhi.controller;


import com.baizhi.annotation.AddCacheAnnotation;
import com.baizhi.annotation.DeleteCacheAnnotation;
import com.baizhi.entity.Menu;
import com.baizhi.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("menu")
public class MenuController {
    @Autowired
    private MenuService menuService;
    @ResponseBody
    @RequestMapping("selectAll")
    @AddCacheAnnotation
    public List<Menu> selectAll(){
        System.out.println("执行了菜单的查询操作,selectAll");
        List<Menu> list = menuService.selectAll();
        return list;

    }
}
